var page = require('webpage').create(),
    system = require('system'),
    address;
if (system.args.length < 1) {
    phantom.exit();
} else {
    address = system.args[1];
    page.open(address, function (status) {
    if (status !== 'success') {
        console.log('Unable to access network');
    } else {
        var ua = page.evaluate(function () {
            //return document.getElementById('preview').textContent;
            return document.getElementById('preview').outerHTML;
        });
        console.log(ua);
    }
    phantom.exit();
});
}